﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="VisitFrequencyList.aspx.cs" Inherits="masterdata_VisitFrequencyList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table id="wsd_inputtable" width="100%">
                <tr>
                    <td class="tabletitle">
                        拜访频率列表
                    </td>
                </tr>
            </table>
            <table id="wsd_listtable" width="100%">
                <tr>
                    <td style="width: 100%">
                        <asp:GridView Width="100%" ID="gvList" DataKeyNames="ID" runat="server" AutoGenerateColumns="False"
                            OnRowDataBound="Grid_RowDataBound" EmptyDataText="没有可显示的数据." EmptyDataRowStyle-Font-Bold="true"
                            EmptyDataRowStyle-HorizontalAlign="Center" EnableEmptyContentRender="true" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
                            AllowPaging="False">
                            <HeaderStyle CssClass="titlist" HorizontalAlign="Center" />
                            <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                            <Columns>
                                <asp:ButtonField ButtonType="Link" CommandName="Select" HeaderText="客户类型" ControlStyle-Font-Underline="false"
                                    DataTextField="CustomerTypeName" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <ControlStyle Font-Underline="False"></ControlStyle>
                                </asp:ButtonField>
                                <asp:ButtonField ButtonType="Link" CommandName="Select" HeaderText="频率"  ControlStyle-Font-Underline="false"
                                    DataTextField="Frequency" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <ControlStyle Font-Underline="False"></ControlStyle>
                                </asp:ButtonField>
                                <asp:BoundField DataField="CycleName" HeaderText="周期" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <asp:TemplateField HeaderText="有效" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <b>
                                            <%# (bool)Eval("IsActive") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="强制完成" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <b>
                                            <%# (bool)Eval("IsCheck") ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="UpdateBy" HeaderText="更新人" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"/>
                                <asp:BoundField DataField="LastUpdate" HeaderText="更新时间" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"/>
                            </Columns>
                            <PagerSettings FirstPageText="首页" LastPageText="尾页" Mode="NumericFirstLast" PageButtonCount="30" />
                            <RowStyle CssClass="evenline" />
                            <AlternatingRowStyle CssClass="oddline" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <table id="wsd_inputtable">
                <tr>
                    <td height="10px" class="tabletitle">
                        操作选项
                    </td>
                </tr>
                <tr>
                    <td class="buttonarea" style="height: 39px">
                        <asp:Button ID="btnAdd" runat="server" class="wsd_button2" Text="新  增" OnClick="btnAdd_Click" />&nbsp;&nbsp;
                    </td>
                </tr>
            </table>
            <div id="editArea" runat="server" visible="false" class="editArea">
                <table id="wsd_inputtable" style="width: 100%">
                    <tr>
                        <td class="tabletitle" style="width: 100%">
                            编辑&nbsp;&nbsp;
                        </td>
                        <td class="tabletitle">
                            <asp:ImageButton ID="ImageButton1" BorderStyle="Solid" runat="server" CausesValidation="false"
                                Height="18" Width="18" ImageUrl="~/Resources/Images/0.png" OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
                <table id="wsd_inputtable" style="width: 100%">
                    <tr>
                        <td class="tablefield">
                            客户类型
                        </td>
                        <td>
                            <select id="ddlType" style="width: 120px" runat="server">
                                <option></option>
                            </select>
                            <asp:Label runat="server" ID="lblCustomerType" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tablefield">
                            拜访周期
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCycle" Style="width: 120px" runat="server" AutoPostBack="true"
                                OnSelectedIndexChanged="ddlCycle_SelectedIndexChanged">
                                <asp:ListItem Value="1" Selected="True">周</asp:ListItem>
                                <asp:ListItem Value="2">月</asp:ListItem>
                                <asp:ListItem Value="3">年</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="tablefield">
                            拜访频率
                        </td>
                        <td>
                            <input type="text" style="width: 120px" maxlength="3" runat="server" id="txtFrequency" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tablefield">
                            有效
                        </td>
                        <td>
                            <input type="checkbox" runat="server" id="chkIsActive" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tablefield">强制规范</td>
                        <td><input type="checkbox" runat="server" id="chkIsChecked" /></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:RequiredFieldValidator ID="rv1" runat="server" ControlToValidate="txtFrequency"
                                ErrorMessage="请输入拜访频率"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="rv2" ControlToValidate="txtFrequency" MinimumValue="0" SetFocusOnError="true"
                                runat="server" MaximumValue="365" ErrorMessage="拜访频率超出范围" Type="Integer" Display="Dynamic"></asp:RangeValidator>
                        </td>
                    </tr>
                </table>
                <table id="wsd_inputtable" style="width: 100%">
                    <tr>
                        <td height="10px" width="100%" class="tabletitle">
                            操作选项
                        </td>
                    </tr>
                    <tr>
                        <td class="buttonarea" style="height: 39px">
                            <asp:Button ID="btnSave" runat="server" class="wsd_button2" Text="保  存" OnClick="btnSave_Click" />&nbsp;&nbsp;
                            <asp:Button ID="btnCancel" runat="server" class="wsd_button2" Text="取  消" CausesValidation="false"
                                OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="back" runat="server">
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnCancel" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="ImageButton1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
